package com.liang.response.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @author liangyehao
 * @version 1.0
 * @date 2021/4/27 23:04
 * @content 明细
 */
@Data
public class Detail {

    @ExcelProperty("日期")
    private Date dateOf;
    @ExcelProperty("运营大区编码（1）")
    private String operatingRegionsEncoding;
    @ExcelProperty("大区")
    private String regional;
    @ExcelProperty("门店")
    private String stores;
    @ExcelProperty("门店首次录客状态")
    private String firstRecordGuestStateStores;
    @ExcelProperty("经纪人姓名")
    private String agentName;
    @ExcelProperty("业务类型名称")
    private String businessTypeName;
    @ExcelProperty("用户ucid")
    private String userId;
    @ExcelProperty("首次商机发起时间")
    private String businessOpportunitiesForFirstTimeByTime;
    @ExcelProperty("是否响应")
    private String whetherResponse;
    @ExcelProperty("是否8-22点")
    private String whether8to22;
    @ExcelProperty("响应时间")
    private Integer responseTime;
    @ExcelProperty("经纪人发送量")
    private Integer agentSend;
    @ExcelProperty("用户消息量")
    private Integer userSend;

    @Override
    public int hashCode() {
        int result = dateOf.hashCode();
        result = 17 * result + agentName.hashCode();
        result = 17 * result + userId.hashCode();
        return result;
    }


    @Override
    public boolean equals(Object obj) {
        if(!(obj instanceof Detail)) {
            // instanceof 已经处理了obj = null的情况
            return false;
        }
        Detail detail = (Detail) obj;
        // 地址相等
        if (this == detail) {
            return true;
        }
        // 同一天同一个经纪人同一个用户
        return detail.getAgentName().equals(this.agentName)
                && detail.getUserId().equals(this.userId)
                && detail.getDateOf().getTime() == this.getDateOf().getTime();
    }



}
